﻿using GKQC.Common;
using GKQC.DbHelper.Dao;
using GKQC.DbHelper.DbModels;
using GKQC.DbHelper.ViewModels;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;

namespace GKQC.DbHelper.Services
{
    public class ReportDbService
    {
        public static List<ReportSetModel> GetReports(AllDbContext dbContext)
        {
            return dbContext.QcDb.Queryable<ReportSetModel>().ToList();
        }

        public static List<ReportSetModel> GetReports(AllDbContext dbContext,string billName)
        {
            return dbContext.QcDb.Queryable<ReportSetModel>().Where(r => r.IsUse == 1 && r.BillName == billName)
                .OrderBy(t => t.SortId)
                .ToList();
        }
    }
}
